package com.weaver.openapi.util;

import java.util.*;

public class HostUtil
{
    public static String beforeRequestCheckHeaders(String host, Map<String, String> header, final String contentType) {
        if (header == null) {
            header = new HashMap<String, String>();
        }
        header.put("Content-Type", contentType);
        if (host == null) {
            return "";
        }
        if (host.endsWith("/")) {
            host = host.substring(0, host.lastIndexOf("/"));
        }
        return host;
    }
}
